<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns location information for a timezone</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="datetimezone.construct.html">DateTimeZone::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="datetimezone.getname.html">DateTimeZone::getName</a></div>
 <div class="up"><a href="class.datetimezone.html">DateTimeZone</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="datetimezone.getlocation" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DateTimeZone::getLocation</h1>
  <h1 class="refname">timezone_location_get</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0)</p><p class="refpurpose"><span class="refname">DateTimeZone::getLocation</span> -- <span class="refname">timezone_location_get</span> &mdash; <span class="dc-title">Returns location information for a timezone</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-datetimezone.getlocation-description">
  <h3 class="title">说明</h3>
  <p class="para">面向对象风格</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type">array</span> <span class="methodname"><strong>DateTimeZone::getLocation</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">过程化风格</p>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><a href="function.timezone-location-get.html" class="methodname">timezone_location_get</a></span>
    ( <span class="methodparam"><span class="type"><a href="class.datetimezone.html" class="type DateTimeZone">DateTimeZone</a></span> <code class="parameter">$object</code></span>
   )</div>

  <p class="para rdfs-comment">
   Returns location information for a timezone, including country code, latitude/longitude and comments.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-datetimezone.getlocation-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    <dt>
<em><code class="parameter">
object</code></em></dt>
<dd>
<p class="para">仅过程化风格：由 <span class="function"><a href="function.timezone-open.html" class="function">timezone_open()</a></span> 返回的
<a href="class.datetimezone.html" class="classname">DateTimeZone</a> 对象。</p></dd>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-datetimezone.getlocation-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Array containing location information about timezone.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-datetimezone.getlocation-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2214">
    <p><strong>Example #1 <span class="function"><strong>DateTimeZone::getLocation()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$tz&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">DateTimeZone</span><span style="color: #007700">(</span><span style="color: #DD0000">"Europe/Prague"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$tz</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getLocation</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">timezone_location_get</span><span style="color: #007700">(</span><span style="color: #0000BB">$tz</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Array
(
    [country_code] =&gt; CZ
    [latitude] =&gt; 50.08333
    [longitude] =&gt; 14.43333
    [comments] =&gt; 
)
Array
(
    [country_code] =&gt; CZ
    [latitude] =&gt; 50.08333
    [longitude] =&gt; 14.43333
    [comments] =&gt; 
)
</pre></div>
    </div>
   </div>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="datetimezone.construct.html">DateTimeZone::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="datetimezone.getname.html">DateTimeZone::getName</a></div>
 <div class="up"><a href="class.datetimezone.html">DateTimeZone</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
